﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Common.RunModels.Base
{
    public class DepartModel
    {
        public string OrgId { get; set; }
        public string DepartId { get; set; }

        public string DepartCode { get; set; }

        public string DepartName { get; set; }

        public string ParentId { get; set; }

        public string ParentName { get; set; }

        public string ParentCode { get; set; }

        public string id { get; set; }

        public string UserId { get; set; }

        public bool IsLine { get; set; }

        public int Level { get; set; }

        public bool IsStatis { get; set; }
        public string ApiKey { get; set; }
    }

    public class DepartTreeParamModel
    {
        public List<string> DepartIds { get; set; } = new List<string>();

        public List<string> DepartCodes { get; set; } = new List<string>();
    }

    public class DepartTreeResultModel
    {
        public List<DepartTreeDetailResultModel> Details { get; set; } = new List<DepartTreeDetailResultModel>();
    }

    public class DepartTreeDetailResultModel
    {
        public string DepartId { get; set; }

        public string DepartCode { get; set; }

        public string DepartName { get; set; }

        public List<string> ParentIds { get; set; } = new List<string>();
        public List<string> ParentCodes { get; set; } = new List<string>();

        public List<string> ChildrenIds { get; set; } = new List<string>();
        public List<string> ChildrenCodes { get; set; } = new List<string>();

        public List<DepartTreeDetailParentResultModel> Parents { get; set; } = new List<DepartTreeDetailParentResultModel>();

        public List<DepartTreeDetailChildrenResultModel> Childrens { get; set; } = new List<DepartTreeDetailChildrenResultModel>();
    }

    public class DepartTreeDetailParentResultModel
    {
        public string DepartId { get; set; }

        public string DepartCode { get; set; }

        public string DepartName { get; set; }
    }

    public class DepartTreeDetailChildrenResultModel
    {
        public string DepartId { get; set; }

        public string DepartCode { get; set; }

        public string DepartName { get; set; }

        public List<DepartTreeDetailChildrenResultModel> Childrens { get; set; } = new List<DepartTreeDetailChildrenResultModel>();
    }

    /// <summary>
    /// 获取部门信息集合请求参数
    /// </summary>
    public class DepartsModel
    {
        /// <summary>
        /// 要排除的部门ID
        /// </summary>
        public string DepartId { get; set; }

        /// <summary>
        /// 是否获取父级部门
        /// </summary>
        public bool IsGetParentsModel { get; set; } = false;

        /// <summary>
        /// 是否获取所有父级部门
        /// </summary>
        public bool IsGetAllParentsModel { get; set; } = false;

        /// <summary>
        /// 等级DepLevelEnum  无 = 0, 线体 = 1,组别 = 2, 课别 = 3,部门 = 4,制造部 = 5,BU = 6
        /// </summary>
        public List<int> Levels { get; set; } = new List<int>();
    }

    /// <summary>
    /// 根据用户ID和层级向上获取部门信息请求参数
    /// </summary>
    public class DepartByUserIdAndLevelModel
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public string UserId{ get; set; }

        /// <summary>
        /// 等级DepLevelEnum  无 = 0, 线体 = 1,组别 = 2, 课别 = 3,部门 = 4,制造部 = 5,BU = 6
        /// </summary>
        public int Level { get; set; }
    }
}
